<template>
  <div class="py-6">
    <div class="mb-6">
      <h1 class="text-2xl font-bold text-gray-900">我的工单</h1>
      <p class="mt-1 text-sm text-gray-500">查看和管理您提交的工单</p>
    </div>

    <!-- 筛选和搜索 -->
    <div class="bg-white shadow rounded-lg mb-6">
      <div class="px-4 py-5 sm:p-6">
        <div class="grid grid-cols-1 gap-4 sm:grid-cols-4">
          <div>
            <label for="search" class="block text-sm font-medium text-gray-700">搜索</label>
            <div class="mt-1">
              <input type="text" id="search" class="shadow-sm focus:ring-primary focus:border-primary block w-full sm:text-sm border-gray-300 rounded-md" placeholder="工单号或关键词">
            </div>
          </div>
          <div>
            <label for="status" class="block text-sm font-medium text-gray-700">状态</label>
            <div class="mt-1">
              <select id="status" class="shadow-sm focus:ring-primary focus:border-primary block w-full sm:text-sm border-gray-300 rounded-md">
                <option value="">全部状态</option>
                <option value="pending">待处理</option>
                <option value="processing">处理中</option>
                <option value="resolved">已解决</option>
                <option value="closed">已关闭</option>
              </select>
            </div>
          </div>
          <div>
            <label for="category" class="block text-sm font-medium text-gray-700">分类</label>
            <div class="mt-1">
              <select id="category" class="shadow-sm focus:ring-primary focus:border-primary block w-full sm:text-sm border-gray-300 rounded-md">
                <option value="">全部分类</option>
                <option value="network">网络问题</option>
                <option value="hardware">硬件故障</option>
                <option value="software">软件安装</option>
                <option value="account">账户权限</option>
                <option value="other">其他问题</option>
              </select>
            </div>
          </div>
          <div class="flex items-end">
            <button class="w-full bg-primary border border-transparent rounded-md shadow-sm py-2 px-4 text-sm font-medium text-white hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">
              搜索
            </button>
          </div>
        </div>
      </div>
    </div>

    <!-- 工单列表 -->
    <div class="bg-white shadow overflow-hidden sm:rounded-lg">
      <div class="border-t border-gray-200">
        <table class="min-w-full divide-y divide-gray-200">
          <thead class="bg-gray-50">
            <tr>
              <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">工单号</th>
              <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">标题</th>
              <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">分类</th>
              <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">提交时间</th>
              <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
              <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
            </tr>
          </thead>
          <tbody class="bg-white divide-y divide-gray-200">
            <tr>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">TKT-20230801-001</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">网络连接问题</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">网络问题</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-08-01 10:30</td>
              <td class="px-6 py-4 whitespace-nowrap">
                <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">已完成</span>
              </td>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                <router-link to="/client/tickets/1" class="text-primary hover:text-primary-dark">查看</router-link>
              </td>
            </tr>
            <tr>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">TKT-20230805-002</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">软件安装请求</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">软件安装</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-08-05 14:15</td>
              <td class="px-6 py-4 whitespace-nowrap">
                <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">处理中</span>
              </td>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                <router-link to="/client/tickets/2" class="text-primary hover:text-primary-dark">查看</router-link>
              </td>
            </tr>
            <tr>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">TKT-20230810-003</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">硬件故障报告</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">硬件故障</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-08-10 09:45</td>
              <td class="px-6 py-4 whitespace-nowrap">
                <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">待处理</span>
              </td>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                <router-link to="/client/tickets/3" class="text-primary hover:text-primary-dark">查看</router-link>
              </td>
            </tr>
            <tr>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">TKT-20230812-004</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">账户权限申请</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">账户权限</td>
              <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-08-12 16:20</td>
              <td class="px-6 py-4 whitespace-nowrap">
                <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">已完成</span>
              </td>
              <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                <router-link to="/client/tickets/4" class="text-primary hover:text-primary-dark">查看</router-link>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      
      <!-- 分页 -->
      <div class="bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6">
        <div class="flex-1 flex justify-between sm:hidden">
          <a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> 上一页 </a>
          <a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> 下一页 </a>
        </div>
        <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
          <div>
            <p class="text-sm text-gray-700">
              显示第 <span class="font-medium">1</span> 到 <span class="font-medium">4</span> 条记录，共 <span class="font-medium">4</span> 条记录
            </p>
          </div>
          <div>
            <nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
              <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                <span class="sr-only">上一页</span>
                <i class="fa fa-chevron-left"></i>
              </a>
              <a href="#" aria-current="page" class="z-10 bg-primary border-primary text-white relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 1 </a>
              <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                <span class="sr-only">下一页</span>
                <i class="fa fa-chevron-right"></i>
              </a>
            </nav>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
</script>